 <style>
.mouseoverBag { background: #abcdef; }
.planTd{BORDER-LEFT:1px solid;BORDER-BOTTOM:1px solid;height:25px;width:15%;}
label { display:block; }
fieldset { padding:0; border:0; margin-top:25px; }
.fieldsetInput{ padding-top:12px;border:0;}
h1 { font-size: 1.2em; margin: .6em 0; }

.validateTips { border: 1px solid transparent; padding: 0.3em; }
 </style>

        <g:set var="entityName" value="${message(code: 'plan.label', default: 'Plan')}" />
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop"> 
                             <%
                                def groupByUnitTimeList = planList.groupBy{
                                    it.restTime.unitTime
                                }
                              %>
                              <td width="120px;"  class="planTd">上课时间</td>
                            <g:each in="${['一','二','三','四','五']}" status="i" var="weekInstance">
                                <td class="planTd">周${weekInstance}</td>
                            </g:each>
                            </tr> 
                                    <%
                                        groupByUnitTimeList.each{
                                        %>            
                                        <tr>  
                                        <td class="planTd">
                                        ${it.value[0].restTime.startHour}:
                                        ${it.value[0].restTime.startMinute}
                                        ~
                                        ${it.value[0].restTime.endHour}:
                                        ${it.value[0].restTime.endMinute}
                                        </td>
                                        <%
                                            it.value.each{elem ->                                                 
                                        %>                                            
                                            <td class="everyCourse ${elem.course} planTd" id="course${elem.id}" teacherId="${elem?.teacher?.id}" planID="${elem.id}" course="${elem.course}">
                                                <font color="red">${elem.course}</font><br>${elem.teacher}
                                            </td>
                                        <%
                                            }
                                         %> 
                                          </tr>
                                    <%
                                        }
                                    %> 
                        </tbody>
                    </table>
                </div> 
               
             <g:form action="resetSave" method="post" name="planCreate" controller="planMgr">
                <div class="" id="postResetCourseAndTeacher">
                    <input type="hidden" name="courseAndTeacher" value=""/>
                    <input type="hidden" name="courseAndTeacher" value=""/>

                </div>
                <g:hiddenField name="classesid" value="${classesid}"/>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /><input type="button" value="返回" onclick="javascript:history.go(-1)"></span>
                </div>
            </g:form>
            <div id="dialog-form" title="选择课程和老师">
            <label id="validName"></label>
            <form>
            <fieldset>
        <table align="center">
                <tr>
                    <td width="20%" class="fieldsetInput">
                        课程 : 
                    </td>
                    <td valign="top">
                            <g:select name="course" from="${courselst}" optionKey="code" optionValue="code" class="text ui-widget-content ui-corner-all" noSelection="['':'-请选择-']"/>
                    </td>
                </tr>
                <tr>
                    <td class="fieldsetInput">
                        老师 : 
                    </td>
                    <td valign="top">
                            <select name="teacher" id="teacher" class="text ui-widget-content ui-corner-all"></select>
                            <g:each in="${teacherlst}" status="i" var="teacherCourseInstance">
                                    <textarea style="display:none" id="${teacherCourseInstance?.key}">
                                         <g:each in="${teacherCourseInstance?.value}" status="m" var="teacherInstance">
                                            <option value="${teacherInstance?.id}">${teacherInstance?.name}</option>
                                        </g:each>
                                    </textarea>
                            </g:each>
                    </td>
                </tr>
            </table>
            </fieldset>
            </form>
        </div>

